package com.zhentao.controller;


import com.zhentao.common.enums.admin.AdMembership;

import com.zhentao.dtos.Result;
import com.zhentao.service.AdMembershipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
//会员列表

@RestController
public class AdMembershipController {

    @Autowired
    private AdMembershipService adMembershipService;

    @RequestMapping(value = "/membership/list",method = RequestMethod.GET)
    public Result list(){
        return adMembershipService.membershipList();
    }

    @RequestMapping(value = "/membership/add",method = RequestMethod.PUT)
    public Result add(@RequestBody AdMembership adMembership){
        return adMembershipService.membershipAdd(adMembership);
    }

    @RequestMapping(value = "/membership/update",method = RequestMethod.PUT)
    public Result update(@RequestBody AdMembership adMembership){
        return adMembershipService.membershipUpdate(adMembership);
    }

    @RequestMapping(value = "/membership/delete",method = RequestMethod.DELETE)
    public Result delete(@RequestParam("id") Integer id){
        return adMembershipService.membershipDelete(id);
    }

}
